<?php
include ("produceinfo.php");
 ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>商品库存管理</title>
    <script type="text/javascript" src="js/time.js"></script>
    <script src="jquery.js" ></script>
    <script >
        function test() {
            document.addclient.submit();
        }
    </script>
</head>
<body background="../../money/pic/topbg.jpg">
    <table width="98%" height=""  border="0" cellpadding="0" cellspacing="0" >
        <tr>
            <td height="22" valign="top" class="word_orange">当前位置：导航栏&gt;商品库存管理 &gt; &gt; </td>
        </tr>
    </table>
    <br>
    <table width="1300" border="0" cellspacing="0" cellpadding="0" align="center">
         <thead>
           <table width="63%"  border="1" cellpadding="0" cellspacing="0" bordercolor="#e3F4F7" bordercolordark="#D2E3E6" bordercolorlight="#FFFFFF" align="center">
            <tr align="center" bgcolor="#e3F4F7">
            <th>商品型号</th>
            <th>商品名称</th>
            <th>单价</th>
            <th>入库数量</th>
            <th>生产入库时间</th>
            <th>生产者</th>
            <th>所需材料名称</th>
            <th>消耗材料数量</th>
            <th>商品信息</th>
            <th>操作</th>
          </tr>
         </thead>
        <?php foreach($producel as $value){ ?>
          <tr>
                <form action="produce.php" method="post" name="updateproduce" >
                 <td><input id="seq" name="seq" size="10" value="<?php echo $value[0] ?>" /></td>
                <td><input id="name" name="name" size="10" value="<?php echo $value[1] ?>"/></td>
                <td><input id="price" name="price"size="5" value="<?php echo $value[2] ?>"/></td>
                <td><input id="num" name="num"  size="8"value="<?php echo $value[3] ?>"/></td>
                <td>
                    <input type="text" name="starttime"style="border:1px solid #999;" onclick="fPopCalendar(event,this,this)" onfocus="this.select()" readonly="readonly" size="15" value="<?php echo $value[4] ?>"/>
                </td>
                <td><input type="text" name="uid" size="10"value="<?php echo $value[5] ?>"/></td>
                <td><input   type="text"  disabled="disabled" id="materialname" size="12"
                            value="<?php echo $value[7] ?>" />
                </td>
                <td><input id="neednum" name="neednum"  size="12"value="<?php echo $value[8] ?>"/></td>
                <td><input id="info" name="info" size="15" value="<?php echo $value[6] ?>"></td>
                <td>
                    <input type="hidden" name="id" value="<?php echo $value[9] ?>"/>
                    <input type="submit" name="updateproduce" value="修改" />
                </td>
                </form>

                <form action="produce.php" method="post" name="delproduce" >
                <td>
                    <input type="hidden" name="id" value="<?php echo $value[9] ?>"/>
                    <input type="submit" name="delproduce" value="删除" />
                </td>
                </form>
           </tr>
        <?php }?>
            <form action="produce.php" method="post" name="addproduce" >
           <tr>
                <td><input id="seq" name="seq" size="10"value="" /></td>
                <td><input id="name" name="name"size="10" value=""/></td>
                <td><input id="price" name="price" size="5" value=""/></td>
                <td><input id="num" name="num" size="8" value=""/></td>
               <td>
                   <input type="text" name="starttime"style="border:1px solid #999;" onclick="fPopCalendar(event,this,this)" onfocus="this.select()" readonly="readonly" size="15" value=""/>
               </td>
                <td><input type="text" name="uid" size="10" value=""/></td>
                <td><select name="materialname" id="select" onchange="test()" >
                       <option>--请选择--</option>
                       <?php foreach($pmaterial as $value1) { ?>
                           <option value="<?php echo $value1[1] ?>" <?php if(@$_POST['materialname']==$value1[1])  echo  "selected" ?>>
                               <?php echo $value1[1] ?>
                           </option>
                       <?php } ?>
                   </select>
                </td>
               <td><input id="neednum" name="neednum"  size="12"value=""/></td>
                <td><input id="info" name="info"size="15" value=""></td>
                <td>
                    <input name="addproduce" type="submit" value="添加" />
                </td>
            </tr>
            </form>
           </table>
    </table>
</body>
</html>
